package com.easonji.common.constant.enums;

/**
 * @ClassName: BizLogTypeEnum
 * @Description: 业务日志类型
 * @Author: LiuJun
 * @date: 2018/07/08 18:06
 * @Version: 1.0
 * @Copyright: Copyright (c) 2018 - 2019
 */
public enum BizLogTypeEnum {
    /**
     * 全部
     */
    ALL(0, null),
    /**
     * 业务日志
     */
    BUSSINESS(1, "业务日志"),
    /**
     * 异常日志
     */
    EXCEPTION(2, "异常日志");

    private Integer val;

    private String message;

    BizLogTypeEnum(Integer val, String message) {
        this.val = val;
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getVal() {
        return val;
    }

    public void setVal(Integer val) {
        this.val = val;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return null;
        } else {
            for (BizLogTypeEnum bizLogType : BizLogTypeEnum.values()) {
                if (bizLogType.getVal().equals(value)) {
                    return bizLogType.getMessage();
                }
            }
            return null;
        }
    }
}
